package uy.com.tsi2G7.superbet.bet;

import java.math.BigDecimal;
import java.rmi.RemoteException;
import java.util.List;

import javax.ejb.Local;

import uy.com.tsi2G7.superbet.account.InsufficientFoundException;
import uy.com.tsi2G7.superbet.account.dao.AccountNotFoundException;
import uy.com.tsi2G7.superbet.ui.BetHistoryDescriptor;
import uy.com.tsi2G7.superbet.user.UserNotificationException;


@Local
public interface BetService {

	void doSimpleBet(String userId, long eventTypeId,
			long eventId, long marketId,long marketResultId, BigDecimal amount) throws RemoteException, AccountNotFoundException, InsufficientFoundException;

	void doUserBet(String userId, long eventTypeId,
			long eventId, long marketId,long marketResultId, BigDecimal amount, boolean result) throws RemoteException, AccountNotFoundException, InsufficientFoundException;
	
	public List<BetHistoryDescriptor> getlastUserSimpleBetsDescription(String userId);
	
	public List<BetHistoryDescriptor> getPendingUserBetsDescription(String userId);

	public void fireEventFinished(long eventTypeId, long marketId) throws RemoteException, AccountNotFoundException, UserNotificationException;

	void doBet(Bet bet) throws RemoteException, AccountNotFoundException, InsufficientFoundException;

	void updateResultAndBets(long market, long result) throws RemoteException, AccountNotFoundException, UserNotificationException;

	public Bet confirmUserBet(String userId,long marketId,long marketResultId) throws RemoteException, AccountNotFoundException, InsufficientFoundException;
}
